/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.doctor;

import entities.DoctorDetails;
import java.util.ArrayList;
import javax.swing.ComboBoxModel;
import javax.swing.event.ListDataListener;

/**
 *
 * @author VietLH
 */
public class DoctorComboBoxModel implements ComboBoxModel{
    private ArrayList<DoctorDetails> doctorList;
    private DoctorDetails selection;

    public DoctorComboBoxModel(ArrayList<DoctorDetails> doctorList) {
        this.doctorList=new ArrayList<DoctorDetails>();
        this.selection=new DoctorDetails();
        this.doctorList = doctorList;
    }
    

   @Override
    public void setSelectedItem(Object anItem) {
        selection= (DoctorDetails)anItem;
//        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public Object getSelectedItem() {
        return selection;
//        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public int getSize() {
        return doctorList.size();
//        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public Object getElementAt(int index) {
        return doctorList.get(index);
//        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void addListDataListener(ListDataListener l) {
//        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void removeListDataListener(ListDataListener l) {
//        throw new UnsupportedOperationException("Not supported yet.");
    }
    
}
